package com.wofish.goods.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wofish.goods.mapper.TypeBrandMapper;
import com.wofish.goods.domain.TypeBrand;
import com.wofish.goods.service.ITypeBrandService;
import com.wofish.common.core.text.Convert;

/**
 * 品牌类型 服务层实现
 * 
 * @author wofish
 * @date 2019-06-10
 */
@Service
public class TypeBrandServiceImpl implements ITypeBrandService {
	@Autowired
	private TypeBrandMapper typeBrandMapper;

	/**
     * 查询品牌类型信息
     * 
     * @param id 品牌类型ID
     * @return 品牌类型信息
     */
    @Override
	public TypeBrand selectTypeBrandById(Long id) {
	    return typeBrandMapper.selectTypeBrandById(id);
	}
	
	/**
     * 查询品牌类型列表
     * 
     * @param typeBrand 品牌类型信息
     * @return 品牌类型集合
     */
	@Override
	public List<TypeBrand> selectTypeBrandList(TypeBrand typeBrand) {
	    return typeBrandMapper.selectTypeBrandList(typeBrand);
	}

	@Override
	public List<Long> selectBrandIdListByType(Long typeId) {
		return typeBrandMapper.selectBrandIdListByType(typeId);
	}

	/**
     * 新增品牌类型
     * 
     * @param typeBrand 品牌类型信息
     * @return 结果
     */
	@Override
	public int insertTypeBrand(TypeBrand typeBrand) {
	    return typeBrandMapper.insertTypeBrand(typeBrand);
	}

	@Override
	public int insertBatchTypeBrand(List<TypeBrand> list) {
		return typeBrandMapper.insertBatchTypeBrand(list);
	}

	/**
     * 修改品牌类型
     * 
     * @param typeBrand 品牌类型信息
     * @return 结果
     */
	@Override
	public int updateTypeBrand(TypeBrand typeBrand) {
	    return typeBrandMapper.updateTypeBrand(typeBrand);
	}

	/**
     * 删除品牌类型对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteTypeBrandByIds(String ids) {
		return typeBrandMapper.deleteTypeBrandByIds(Convert.toStrArray(ids));
	}

	@Override
	public int deleteByTypeId(Long typeId) {
		return typeBrandMapper.deleteByTypeId(typeId);
	}
}
